//package com.glsc.ngateway.common.base.repo.mysql.opmanage.report.excel;
//
//import org.springframework.data.jpa.repository.JpaRepository;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.jpa.repository.Modifying;
//import org.springframework.data.jpa.repository.Query;
//import org.springframework.data.repository.query.Param;
//import org.springframework.stereotype.Repository;
//import org.springframework.transaction.annotation.Transactional;
//
//import java.time.LocalDateTime;
//import java.util.List;
//
//@Repository
//public interface TStepStatusRepo extends JpaRepository<TStepStatus, Integer>, JpaSpecificationExecutor<TStepStatus>, TStepStatusBaseRepo {
//
//    @Override
//    @Transactional
//    @Modifying
//    @Query(value = "update glsc_data.t_step_status  set fc_msg = :msg where fl_stepid = :id and fc_bizdate=:bizdate",nativeQuery = true)
//    void updateMsg(@Param("msg") String msg, @Param("id") Integer id, @Param("bizdate") String bizdate);
//
//    @Override
//    @Transactional
//    @Modifying
//    @Query(value = "update glsc_data.t_step_status  set fd_endTime = :endtime where fl_stepid = :id and fc_bizdate=:bizdate",nativeQuery = true)
//    void updateEndtime(@Param("endtime") LocalDateTime endtime, @Param("id") Integer id, @Param("bizdate") String bizdate);
//
//    @Override
//    @Transactional
//    @Modifying
//    @Query(value = "update glsc_data.t_step_status  set fd_begintime = :beginTime where fl_stepid = :id and fc_bizdate=:bizdate",nativeQuery = true)
//    void updateBegintime(@Param("beginTime") LocalDateTime beginTime, @Param("id") Integer id, @Param("bizdate") String bizdate);
//
//    @Override
//    @Transactional
//    @Modifying
//    @Query(value = "update glsc_data.t_step_status  set fl_status = :status where fl_stepid = :id and fc_bizdate=:bizdate",nativeQuery = true)
//    void updateStatus(@Param("status") Integer status, @Param("id") Integer id, @Param("bizdate") String bizdate);
//
//    @Override
//    @Transactional
//    @Modifying
//    @Query(value = "delete from glsc_data.t_step_status where fc_bizdate=:bizdate and fl_stepid in :idList",nativeQuery = true)
//    void clearStatus( @Param("bizdate") String bizdate,@Param("idList") List<Integer> idList);
//
//    @Override
//    @Query(value = "select t1.*, t2.fl_status,t2.fd_begintime,t2.fd_endtime,t2.fc_modifier,        t2.fc_msg\n" +
//            "  from glsc_data.t_step t1 \n" +
//            "       left join glsc_data.t_step_status t2 \n" +
//            "              on t2.fl_stepid = t1.fl_id \n" +
//            "             and t2.fl_assetid = 0 \n" +
//            "             and t2.fc_bizdate = :bizdate\n" +
//            " where t1.fl_enable = 1\n" +
//            " order by t1.fl_steptype,t1.fl_order,t1.fc_stepname",nativeQuery = true)
//    List<TaskStatus> listStatus(@Param("bizdate") String bizdate);
//
//    @Override
//    @Query(value = "select t1.fl_id\n" +
//            "  from glsc_data.t_step t1 \n" +
//            "       left join glsc_data.t_step_status t2 \n" +
//            "              on t2.fl_stepid = t1.fl_id \n" +
//            "             and t2.fl_assetid = 0 \n" +
//            "             and t2.fc_bizdate = :bizdate\n" +
//            " where t1.fl_enable = 1\n" +
//            " order by t1.fl_steptype,t1.fl_order,t1.fc_stepname",nativeQuery = true)
//    List<Integer> listIds(@Param("bizdate") String bizdate);
//
//    @Override
//    @Query(value = "select t1.fl_stepid\n" +
//            "  from glsc_data.t_step_status t1 \n" +
//            " where t1.fc_bizdate = :bizdate and t1.fl_status=2\n",nativeQuery = true)
//    List<Integer> listRunningIds(@Param("bizdate") String bizdate);
//
//    @Override
//    @Query(value = "select tc.vc_trade_dt \n" +
//            "            from glam_data.trade_calendar tc \n" +
//            "           where exchange = 'ND'\n" +
//            "             and tc.trade_days <= current_date-1 \n" +
//            "             and tc.trade_days >= (select max(t.trade_days)  from glam_data.trade_calendar t  where t.exchange = 'SSE'  and t.trade_days <= current_date-1)\n" +
//            "            order by tc.vc_trade_dt",nativeQuery = true)
//    List<String> listDate();
//
//    @Override
//    @Query(value = "select tc.vc_trade_dt \n" +
//            "            from glam_data.trade_calendar tc \n" +
//            "           where tc.exchange = 'ND'\n" +
//            "             and tc.trade_days <= current_date-1 \n" +
//            "             and tc.trade_days >= cast(:bizdate as date) \n" +
//            "            order by tc.vc_trade_dt",nativeQuery = true)
//    List<String> listDate(@Param("bizdate") String bizdate);
//}
